/**
 * @author Administrator
 */
var BottomTip = new Class({
	Implements: [Options, Events],
	
	options:
	{
		className: 'bottombubble',
		autoHideTime: 0,
		moveTime: 3000
	},
	
	initialize: function(options)
	{
		this.setOptions(options);
		
		this.Container = new Element('div', {
			'class': this.options.className,
			'styles':{
				'overflow': 'hidden',
				'right': '0px',
				'bottom': '0px',
				'position': 'absolute',
				'visibility': 'hidden'
			}
		});
		
		this.Content = this.Container.appendChild(new Element('div', {
			'styles':{
				'position': 'relative'
			}
		}));
		
		this.FxShow = new Fx.Tween(this.Content, {
			'unit': 'px',
			'duration': this.options.moveTime
		});
		
		window.addEvent('domready', (function(){
			document.body.appendChild(this.Container);
		}).bind(this));
	},
	
	show: function()
	{
		var contentSize = this.Content.getSize();
		this.Container.setStyles({
			'right': '0px',
			'bottom': '0px',
			'width': contentSize.x + 'px',
			'height': contentSize.y + 'px'
		});
		
		this.Container.pin();
		
		this.FxShow.set('top', contentSize.y);
		this.FxShow.start('top', contentSize.y, 0);
		this.Container.style.visibility = 'visible';
	},
	
	hide: function()
	{
		this.Container.style.visibility = 'hidden';
		this.Container.unpin();
	}
});
